FROM node:slim AS stage
WORKDIR /opt/build
COPY package.json package.json
RUN npm install
COPY . .
RUN echo 'REF_URL=https://tendcode.com/\nREF_LABEL=网站首页' > .env && npm run build

FROM nginx:stable-alpine
COPY --from=stage /opt/build/dist /usr/share/nginx/html
